package com.it.xiaotao.mode.ChainOfResponsibility;

public class TestRequest {
    public static void main(String[] args) {
        HandlerA handlerA = new HandlerA();
        HandlerB handlerB = new HandlerB();
        HandlerC handlerC = new HandlerC();
        handlerA.setHandler(handlerB);
        handlerB.setHandler(handlerC);
        Request requestA = new Request(RequestType.TYPE_A, "请求A");
        Request requestB = new Request(RequestType.TYPE_B, "请求B");
        Request requestC = new Request(RequestType.TYPE_C, "请求C");
        handlerA.handleRequest(requestA);
        handlerA.handleRequest(requestB);
        handlerA.handleRequest(requestC);
    }
}
